package com.aq.appserver.server.system.controller;

import java.util.Iterator;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.aq.appserver.common.bean.BaseResp;
import com.aq.appserver.server.system.entity.SystemInfo;
import com.aq.appserver.server.system.service.SystemService;

@Controller
@RequestMapping("/system")
public class SystemController {
	
	@Autowired
	private SystemService systemService;
	
	@RequestMapping("querySystem")
    @ResponseBody
	public Object querySystem(HttpServletRequest request) {
		BaseResp resp = new BaseResp();
		Iterable<SystemInfo> systemInfoList = systemService.querySystemInfo();
		SystemInfo systemInfo = new SystemInfo();
		Iterator<SystemInfo> iterator = systemInfoList.iterator();
		while(iterator.hasNext()) {
			systemInfo = iterator.next();
		}
		resp.put("systemInfo", systemInfo);
		return resp;
	}
}
